package structure.proxy;

/**
 * @author dali
 * @date 2021-07-20 21:11
 * @Description
 */

public class Client {
    public static void main(String[] args) {
        IUserDao userDao = new UserDao();
        UserJDKProxy userJDKProxy = new UserJDKProxy(userDao);
        IUserDao proxyInstance = (IUserDao)userJDKProxy.getProxyInstance();
//        proxyInstance.save();
//        System.out.println(proxyInstance);
//        IUserDao proxyInstance1 = (IUserDao)ProxyFactory.getProxyInstance(userDao);
        UserCglibProxy userCglibProxy = new UserCglibProxy(userDao);
        IUserDao proxyInstance1 = (IUserDao)userCglibProxy.getProxyInstance();
        proxyInstance1.save();
        System.out.println(proxyInstance.getClass());
        System.out.println(proxyInstance1.getClass());
    }
}
